<?php

App::uses('AppController', 'Controller');

class MountPricesController extends AppController {
    
    public $uses     = array('MountPrice');
    
    public $paginate = array(
        'limit' => ITEMS_PER_PAGE
    );
    
    public function index() {
        $filter = $this->parseFilterData('MountPrice');
        
        $this->paginate['order'] = "{$filter->sortBy} {$filter->sortDir}";
        $this->set('prices', $this->paginate('MountPrice'));
        $this->setFilterData($filter);
    }
    
    public function create() {
        $this->set('data', $this->MountPrice->create(array(
            'date' => date('Y-m-d')
        )));
        return $this->render('form');
    }
    
    public function edit($id) {
        $this->set('data', $this->MountPrice->findById($id));
        return $this->render('form');
    }
    
    public function save() {
        parent::saveData('MountPrice');
    }
    
}
